package com.example.customview.scrollevent

import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.android.baselibrary.base.BaseDBFragment
import com.android.baselibrary.base.CommonRouterManger
import com.example.customview.R
import com.example.customview.arouter.CustomArouter
import com.example.customview.databinding.ActivityScrollEventBinding
import com.example.customview.scrollevent.`in`.ScrollerInFragment
import com.example.customview.scrollevent.more.ScrollerMoreFragment
import com.example.customview.scrollevent.out.ScrollerOutFragment

@Route(path =CustomArouter.CUSTOM_SCROLLER_EVENT_ACTIVITY)
class ScrollerEventActivity  :BaseDBFragment<ActivityScrollEventBinding>(R.layout.activity_scroll_event),
    View.OnClickListener {
    override fun initView() {
        mBinding.click = this
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.btn_scroll_internal -> {
                CommonRouterManger.instance.navigationActivityParams(
                    CustomArouter.CUSTOM_CONTAINER_ACTIVITY,
                    CustomArouter.EXTRA_KEY_FRAGMENT_PATH to CustomArouter.CUSTOM_SCROLLER_IN_FRAGMENT
                )
            }
            R.id.btn_scroll_out -> {
                CommonRouterManger.instance.navigationActivityParams(
                    CustomArouter.CUSTOM_CONTAINER_ACTIVITY,
                    CustomArouter.EXTRA_KEY_FRAGMENT_PATH to CustomArouter.CUSTOM_SCROLLER_OUT_FRAGMENT
                )
            }
            R.id.btn_scroll_more -> {
                CommonRouterManger.instance.navigationActivityParams(
                    CustomArouter.CUSTOM_CONTAINER_ACTIVITY,
                    CustomArouter.EXTRA_KEY_FRAGMENT_PATH to CustomArouter.CUSTOM_SCROLLER_MORE_FRAGMENT
                )
            }
        }

    }
}